package club.justwill.single.persistence.support;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.OrderBy;

/**
 * Created by luoyu on 15-12-24.
 */
@MappedSuperclass
public abstract class SkusBase extends Jpo{

    @Column(name = "project_id")
    private long projectId;

    @Column(name = "number")
    private Integer number;

    @Column(name = "name")
    private String name ;

    @Column(name = "unitprice")
    private double unitprice;

    @Column(name = "real_price")
    private double realPrice;

    @Column(name = "earnings")
    private String earnings;

    @Column(name = "profit")
    private Double profit;

    @Column(name = "sku_url")
    private String skuUrl;

    @Column(name = "dispatch_price")
    private Double dispatchPrice;

    @Column(name = "max_people")
    private int maxPeople;

    protected void copyBase(SkusBase other) {
        setProjectId(other.getProjectId());
        setNumber(other.getNumber());
        setName(other.getName());
        setUnitprice(other.getUnitprice());
        setEarnings(other.getEarnings());
        setProfit(other.getProfit());
        setSkuUrl(other.getSkuUrl());
        setDispatchPrice(other.getDispatchPrice());
        setMaxPeople(other.getMaxPeople());
    }
    public String getSkuUrl() {
        return skuUrl;
    }

    public void setSkuUrl(String skuUrl) {
        this.skuUrl = skuUrl;
    }

    public double getRealPrice() {
        return realPrice;
    }

    public void setRealPrice(double realPrice) {
        this.realPrice = realPrice;
    }

    public long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        if(projectId == null) {
            this.projectId = 0L;
        } else {
            this.projectId = projectId;
        }
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getUnitprice() {
        return unitprice;
    }

    public void setUnitprice(double unitprice) {
        this.unitprice = unitprice;
    }

    public String getEarnings() {
        return earnings;
    }

    public void setEarnings(String earnings) {
        this.earnings = earnings;
    }

    public Double getProfit() {
        return profit;
    }

    public void setProfit(Double profit) {
        this.profit = profit;
    }

    public int getMaxPeople() {
        return maxPeople;
    }

    public void setMaxPeople(int maxPeople) {
        this.maxPeople = maxPeople;
    }

    public Double getDispatchPrice() {
        return dispatchPrice;
    }

    public void setDispatchPrice(Double dispatchPrice) {
        this.dispatchPrice = dispatchPrice;
    }

    public void setProjectId(long projectId) {
        this.projectId = projectId;
    }
}
